const tocsv = require("../bin/to_worktile_dailyup_csv");
const axios = require("axios").default;
const MQDUI = tocsv.__debug.MQDUI;
let mqduis = [
  new MQDUI([], [], [{
    path: "/a,b/s",
    link: "https://www.baidu.com"
  }, {
    path: "/a/b/efjbshgjak.mkv",
    link: "https://www.baidu.com"
  }], "www.baidu.com"),
  new MQDUI([{
    path: "yui/egfj/wsd",
    reason: "总是失败"
  }], [{
    path: "po/pouhvf/efbh.ini",
    reason: "HTTP 403"
  }], [{
    path: "/a,b/s",
    link: "https://www.baidu.com"
  }, {
    path: "/a/b/efjbshgjak.mkv",
    link: "https://www.baidu.com"
  }], "www.baidu.com"),
];

let csvString = tocsv.generateCsvFromData([{
  title: "Test1",
  infos: mqduis
}, {
  title: "Test2",
  infos: mqduis.concat(mqduis)
}]);

axios.post('https://hook.worktile.com/project/incoming/ab43f868852f45369f9176e8821c8e34', {
  action: "create_task",
  payload: {
    type: "日常杂物上传",
    title: "WebHook Task" + Date(),
    properties: {
      "desc": mqduis[0].toHTML()
    },
  }
}, {
    headers: {
      "Content-Type": "application/json"
    },
    validateStatus: s => true
  }).then(axresp => {
    debugger
  })